package com.kfm.am;

public class StringTest02 {

    public static void main(String[] args) {
        String str = "kaifamiao1234开发喵123";
        String pattern = "\\d{4}";
        String replace = str.replace('a', 'A');
        System.out.println(replace);
        // replaceAll 替换所有满足pattern的内容为新内容
        String kfm = str.replaceAll(pattern, "a");
        // replaceFirst 替换第一次满足pattern的内容为新内容
        String replaceFirst = str.replaceFirst(pattern, "a");
        System.out.println(kfm);
        System.out.println(replaceFirst);
        // contains 字符串中是否有子串
        System.out.println(str.contains("kfm"));

        boolean b = true;
        System.out.println(String.valueOf(b));

        double d = 23.2;
        System.out.println(String.valueOf(d));
    }
}
